const mongoose = require('./db')

const userSchema = new mongoose.Schema({
    username:String,
    password:String,
    phone:String,
    email:String,
})

const userModel = mongoose.model('user',userSchema,'user')

const developmentSchema = new mongoose.Schema({
    depContext : String,
    position: String,
    imgUrl:String,
    userId:{
        type:mongoose.Types.ObjectId,
        ref:'user'
    }
})
const draftSchema = new mongoose.Schema({
    depContext : String,
    position: String,
    imgUrl:String,
    userId:{
        type:mongoose.Types.ObjectId,
        ref:'user'
    },
    artContext:String,
    artTitle:String,
    original: Boolean,
    draftType: String,
    getTime:String,
    delStatus:{
        type:Boolean,
        default:false
    }
})
const articleSchema = new mongoose.Schema({
    artContext : String,
    userId:{
        type:mongoose.Types.ObjectId,
        ref:'user'
    },
    artTitle:String,
    original: Boolean
})
const article = mongoose.model('article',articleSchema,'article')
const draft = mongoose.model('draft',draftSchema,'draft')
const development = mongoose.model('development',developmentSchema,'development')
module.exports = {
    userModel,
    development,
    draft,
    article
}